<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>商品列表</title>
	<link rel="stylesheet" href="<?= AC ?>order-goods.css">
</head>
<body>
	<div class="table-wrap">
		<div class="table-main">
			<div class="ibox-title">
				<h3>商品<small>( <?= $count ?> ) 件</small></h3>
			</div>
			<div class="ibox-content">	
				<form action="index.php" class="form-main" method="get">
					<div class="form-btn">
						<a href="index.php?c=goods&m=add" target="myIframe">+ 新增商品</a>
					</div>
					<div class="form-search">
						<input type="hidden" name="c" value="goods">
						<input type="text" name="search" class="form-control"  placeholder="商品关键字" >
						<input type="submit" class="search-btn" value="搜索">
					</div>
				</form>
				<table class="list-table">
					<thead>
						<tr>
                            <th width="80px">ID</th>
                            <th width="60px">图片</th>
                            <th width="300px">名称</th>
                            <th width="80px">价格</th>
                            <th width="80px">上架</th>
                            <th width="80px">热品推荐</th>
                            <th width="80px">库存</th>
                            <th width="80px">销量</th>
                            <th width="15%">操作</th>
                       </tr>
					</thead>
					<tbody>
						<?php if(empty ($res)):?>
						<tr>
							<th colspan=9>暂无商品信息,请先去添加...</th>
						<?php else:?>
						<?php foreach ($res as $k => $v): ?>
							
							<td><?=$v['id'] ?></td>
							<td>
								<?php if( empty($v['icon']) ):?>
								<img src="<?= AI ?>people_fill.png" alt="" >
								<?php else: ?>
								<img src="<?= imgUrl($v['icon']) ?>" >
								<?php endif; ?>
							</td>
							<td><?=$v['name'] ?></td>
							<td><?=$v['price']?></td>
							<td>
								<a href="index.php?c=goods&m=goodsUp&id=<?= $v['id']?>"><?=$v['up']==1?'在售':'下架' ?></a>
							</td>
							<td><?= $v['hot']==1?'热品':'滞销'?></td>
							<td><?= $v['stock']?></td>
							<td><?= $v['sold']?></td>
							<td>
								<div class="btn-group">
									<a href="../Home/index.php?c=goods&id=<?=$v['id']?>" target="_top" class="btn-white">详情</a>
									<a href="index.php?c=goods&m=Editgoods&id=<?=$v['id']?>" class="btn-white">编辑</a>
									<a href="index.php?c=goods&m=goodsimg&id=<?=$v['id']?>" class="btn-white">加图</a>
									<a href="index.php?c=goods&m=Delgoods&id=<?=$v['id']?>" class="btn-white">删除</a>
									
								</div>
							</td>
						</tr>
						<?php endforeach ?>
						<?php endif ?>
					</tbody>
				</table>
				<div class="btn-limit-group">
					<?= $page->showPage() ?>
				</div>
			</div>
		</div>
	</div>
</body>
</html>